\name{CFHM}
\alias{CFHM}
\title{Counting Fingers and Hand Motion}
\description{A function to parse text data for Counting Fingers (CF) and Hand Motion (HM) and convert them to approximate logMAR values.  This is an internal function and is not typically meant to be called directly.
}
\usage{
CFHM(x, zero)
}
\arguments{
  \item{x}{Character data of the form: "CF 10", "HM 12", "HM", "CF", "CF 2", etc. to be converted to logMAR values.
}
  \item{zero}{A "zero" logMAR value to be used for any CF or HM value missing a number.  May be an actual number or simply \code{NA}.
}
}
\details{
  This treats CF as approximately 200 letters (per Holladay), so CF at 10 feet has Snellen value "equivalent" of 10/200. HM is approximately 10 times worse, so HM at 10 feet approximately 10/2000.  After conversion, rough equivalents are passed to \code{logmar} to actually be converted.

  The \code{zero} argument is used to specify a "zero" logMAR value.  In particular, this is used when no distance information is given (e.g., only "HM" or "CF" as opposed to "CF 6" or "HM 4").  For the reasioning and rational behind this, see the "Details" section of \code{\link{VAConverter}}.
}
\value{A vector the same length as the input containing logMAR values assuming there are at least some non-zero elements, it will be numeric.
}
\references{Jack T. Holladay (2004).  Visual acuity measurements.  \emph{Journal of Cataract & Refractive Surgery, 30}(2), pp. 287--290. DOI: 10.1016/j.jcrs.2004.01.014.  \url{http://www.sciencedirect.com/science/article/B6VSF-4BX5RWS-2/2/c76a1a79f122eed8ace7be814131f749}}
\author{Joshua Wiley, \url{http://joshuawiley.com/}}
\note{This was written in conjunction with several other functions to deal with a very specific style of recording visual acuity for a study I worked on.  It may or may not have much use elsewhere.  \code{CFHM} was not intended to typically be called by the user directly.  Generally, a higher level function, (e.g., \code{VAConverter}) would be called and it would eventually pass values to \code{CFHM}.
}
\seealso{\code{\link{VAConverter}} the overall function typically called, \code{\link{logmar}} for the function that does the final conversion, \code{\link{snellen}} to parse Snellen values (and linearly interpolate if necessary) to pass to \code{logmar}.}

\examples{
## logMAR approximations, note "HM" is just the zero value
Jmisc:::CFHM(c("HM 20", "HM", "CF 20", "CF 12", "CF"), zero = 3)

## In cases where there is insufficient data, rather than choose
## an arbitrary value, you can may just use NA
Jmisc:::CFHM(c("HM 20", "HM", "CF 20", "CF 12", "CF"), zero = NA)
}
\keyword{misc}
